﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Mammoth.Services;

namespace Mammoth.Views.Message
{
    /// <summary>
    /// Interaction logic for MessageView.xaml
    /// </summary>
    public partial class MessageView : UserControl, IEventInterest
    {
        public MessageView(IViewFactory viewFactory)
        {
            InitializeComponent();
            var ib = viewFactory.Create<MessageList>();
            ib.MessageType = Entities.GTalkMessageType.Inbox;
            InboxContainer.Children.Add(ib);
            var ob = viewFactory.Create<MessageList>();
            ob.MessageType = Entities.GTalkMessageType.Outbox;
            OutboxContainer.Children.Add(ob);
        }

        public void ReleaseHandler()
        {
            ((IEventInterest)OutboxContainer.Children[0]).ReleaseHandler();
            ((IEventInterest)InboxContainer.Children[0]).ReleaseHandler();
        }
    }
}
